﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelXML;

namespace ModelTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Cena c = new Cena();
            c.Nome = "nomecena";
            c.Modelos = new List<Modelo>();
            Modelo m = new Modelo();
            m.Name = "modelonome";
            m.Transformation = new Transformation(new Ponto3D(),new Ponto4D(),new Ponto3D());
            m.Indices = new int[1];
            m.Indices[0] = 33;
            m.Vertices = new Vertice[1];
            m.Vertices[0] = new Vertice();
            m.Vertices[0].Normal = new Ponto3D();
            m.Vertices[0].Position = new Ponto3D();
            m.Vertices[0].TextureCoord = new Ponto2D();
            m.Vertices[0].Tangent = new Ponto3D();
            m.Vertices[0].BiNormal = new Ponto3D();            

            Map difuse = new Map();
            difuse.MapType = MapTypes.Diffuse;
            difuse.Path = "abc.bmp";
            m.Maps.Add(difuse);

            SkinInfo si = new SkinInfo();            
            Bone bone = new Bone();
            si.Bones.Add(bone);
            bone.BoneName = "BoneName";
            bone.SkinIndices.Add(0);
            bone.SkinIndices.Add(10);
            bone.SkinIndices.Add(23);
            bone.SkinWeights.Add(50);
            bone.SkinWeights.Add(40);
            bone.SkinWeights.Add(30);
            bone.BoneMatrix = new Transformation(new Ponto3D(), new Ponto4D(), new Ponto3D()); ;
            bone.BoneChilds = new List<string>() { "c1", "c2" };
            bone.BoneParent = "parent";
            AnimationInfo ainfo = new AnimationInfo();
            ainfo.AnimationName = "AnimationName";
            AnimationClip aclip = new AnimationClip();
            aclip.Transformation = new Transformation();
            aclip.time = 10;
            aclip.BoneName = "BoneX";
            ainfo.AnimationClips.Add(aclip);
            si.AnimationInfos.Add(ainfo);
            m.SkinInfo = si;
            c.Modelos.Add(m);

            Helper helper = new Helper("helperName", new Transformation());
            c.Helpers.Add(helper);

            Camera cam = new Camera();
            cam.FarPlane = 2000;
            cam.NearPlane = 1;
            cam.Position = new Ponto3D();
            cam.Target = new Ponto3D();
            cam.Fov = 10;
            cam.Name = "sa";
            c.Cameras.Add(cam);

            Cena.SaveXmlContent(c,"CenaTeste.xml");
            //Cena cena = Cena.LoadXmlContent(@"C:\Users\tpastor\Documents\3dsMax\export\cam.xml");
             
        }
    }
}
